<?php

require_once(WSB_MODULES_PATH . 'sherpa/forms/SherpaForm.php');

class Sherpa_Form_Address extends Sherpa_Form_SherpaForm
{

	public function init()
    {
    	$this->setName('address');

    	// first name
        $element = new Zend_Form_Element_Text('firstName');
        $element->setLabel('sherpaFirstName');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// last name
        $element = new Zend_Form_Element_Text('lastName');
        $element->setLabel('sherpaLastName');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// company
        $element = new Zend_Form_Element_Text('company');
        $element->setLabel('sherpaCompany');
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// street
        $element = new Zend_Form_Element_Text('street');
        $element->setLabel('sherpaStreet');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// poBox
        $element = new Zend_Form_Element_Text('poBox');
        $element->setLabel('sherpaPoBox');
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// zipCode
        $element = new Zend_Form_Element_Text('zipCode');
        $element->setLabel('sherpaZipCode');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// city
        $element = new Zend_Form_Element_Text('city');
        $element->setLabel('sherpaCity');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// country
        $element = new Zend_Form_Element_Text('country');
        $element->setLabel('sherpaCountry');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// phone
        $element = new Zend_Form_Element_Text('phone');
        $element->setLabel('sherpaPhone');
        $element->setRequired(true);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// email
        $element = new Zend_Form_Element_Text('email');
        $element->setLabel('sherpaEmail');
        $element->setRequired(true);
        $emailValidator = new WSB_Validator_EmailAddressSimple();
		$emailValidator->setMessages(array(
			WSB_Validator_EmailAddressSimple::INVALID => 'registrationInvalidEmailAddress'
    	));
        $element->addValidator($emailValidator);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// button
        $element = new Zend_Form_Element_Image('btnCreateAddress');
        $element->setAttrib('src', 'sherpa/img/btn-adresse-verwenden.gif');
		$this->addElement($element);

    }

}
